﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ADOWrapper.ObjectResolver;
using System.Data;

namespace ADOWrapper.Test.ObjectResolver
{
    [TestClass]
    public class TuplePopulatorTest
    {
        [TestMethod]
        public void Populate()
        {

            IObjectPopulator<Tuple<int, int?>> populator = new TuplePopulator<Tuple<int, int?>>();

            Moq.Mock<IDataRecord> mock = new Moq.Mock<IDataRecord>();
            mock.SetupGet(c => c[0]).Returns(() => 1);
            mock.SetupGet(c => c[1]).Returns(() => 2);

            var item = populator.Populate(mock.Object);

            Assert.IsNotNull(item);
            Assert.AreEqual(1, item.Item1);
            Assert.AreEqual(2, item.Item2);

        }
    }
}
